package com.example.util;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;

public class SQLHelp extends SQLiteOpenHelper {

	private final static String NAME="user";
	private final static int VERSION = 2;
	
	public SQLHelp(Context context) {
		super(context, NAME, null, VERSION);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {

		db.execSQL("CREATE TABLE if not exists User_DriverInfo (_id INTEGER primary key autoincrement,DRIVERID VARCHAR,DRIVERNAME VARCHAR,NATIONALITY VARCHAR,ADDRESS VARCHAR,BIRTHDAY VARCHAR,ISSUEDATE VARCHAR,CLASSTYPE VARCHAR,VALIDDATE VARCHAR,VALIDFOR VARCHAR,FILENUMBER VARCHAR)");
		db.execSQL("CREATE TABLE if not exists User_CarInfo (_id INTEGER primary key autoincrement,BarCode VARCHAR,CARNO VARCHAR,CARTYPE VARCHAR,Color VARCHAR,CHECKDATE VARCHAR,VIN VARCHAR,DRIVERID VARCHAR)");
		db.execSQL("CREATE TABLE if not exists User_IllegalInfo (_id INTEGER primary key autoincrement,CARNO VARCHAR, TIME VARCHAR,ADDRESS VARCHAR,NOTES VARCHAR,SCORE VARCHAR,MONEY VARCHAR,STATUS VARCHAR,DEPARTMENT VARCHAR,POLICENAME VARCHAR,X VARCHAR,Y VARCHAR,WEIZHANGDAIMA VARCHAR,DRIVERID VARCHAR)");
		db.execSQL("CREATE TABLE if not exists User_Pictures (_id INTEGER primary key autoincrement, CARNO VARCHAR,CREATE_TIME VARCHAR,VALUE BLOB)");
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
	
	}

	@Override
	public void onOpen(SQLiteDatabase db) {
		super.onOpen(db);

	}

}
